package cn.hnu.qq.server.dao;

import cn.hnu.qq.entity.Crowd;

public interface CrowdDao {
	
	public Crowd findById(Integer Id);
	
	public Crowd findByName(String acount);
	
	public Boolean isExist(String name);
	
	public Boolean isExist(Integer id);
	
	public void persist(Crowd group);
	
	public void merge(Crowd group);

	/**
	 * 
	 * @param user
	 * @param crowd
	 * @return 1 已经存在群组中 0 加入成功  -1 用户或群组不存在
	 */
	public int joinCrowd(String user, String crowd);

	/**
	 * 判断是否已经在群组中
	 * @param user
	 * @return
	 */
	public boolean isAlreadyInCrowd(String user,String crowd);

	public void exitCrowd(String crowd, String user);
}
